package com.example.block_chain.utils;

import com.example.block_chain.domain.pojo.Block;

import java.util.ArrayList;
import java.util.List;

/*
 *@description: 获取Block对象中带签名字段
 *@author: hisen
 *@Time: 2023/11/20  18:09
 */
public class MerkelTreeNodeUtil {
    public static List<String> getTreeNodeList(Block block) {
        List<String> list = new ArrayList<>();
        if (block.getCode() != null) list.add(block.getCode());
        if (block.getDigest() != null) list.add(block.getDigest());
        if (block.getPreHash() != null) list.add(block.getPreHash());
        list.add(block.getCreateTime().toString());
        return list;
    }
}
